﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Fusion.Data;

namespace SS_Demo
{
    class Program
    {
        static void Main(string[] args)
        {

            //Active record template
            /*
            FusionDB.Customer p = new FusionDB.Customer();
            p.Email = "fyasar@triodor.eu";
            p.Name = "Fatih YASAR";
            p.Telephone = "0533 5700869";
            p.Save();

            FusionDB.Order o = new FusionDB.Order();
            o.CustomerId = p.CustomerId;
            o.CreatedDate = DateTime.Now;
            o.Save();
            

            Customer c = new Customer();
            c.Email = "senem@triodor.eu";
            c.Name = "Senem YASAR";
            c.Telephone = "0533 5700879";
            c.Save();
            */


            object instance = System.Activator.CreateInstance(Type.GetType("Fusion.Data.Customer"));
            Type.GetType("Fusion.Data.Customer").GetProperty("Email").SetValue(instance, "senem@hotmail.com", null);
            Type.GetType("Fusion.Data.Customer").GetProperty("Name").SetValue(instance, "Senemim", null);
            Type.GetType("Fusion.Data.Customer").GetProperty("Telephone").SetValue(instance, "0533 5700879", null);
            ((SubSonic.Schema.IActiveRecord)instance).Save();
        }
    }
}
